<%@ page language="java" import="java.util.*,com.ncp.model.biz.product.*,com.ncp.model.dao.*,com.ncp.model.entity.product.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
ArrayList listbasic = (ArrayList)request.getAttribute("listbasicload");
int PageSize = 10;
int showPages=5;
int size=2;
int id=1;
int PageNow = Integer.parseInt((String)request.getAttribute("PageNow"));
int PageCount = Integer.parseInt((String)request.getAttribute("PageCount"));
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'ManagerBasicLoadDel.jsp' starting page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	--><%--
	<link href="css/common.css" type="text/css" rel="stylesheet" />
<link href="css/item.css" type="text/css" rel="stylesheet" />
<script src="js/cart/cart.js" type="text/javascript" charset="UTF-8"></script>
--%><script text="text/JavaScript">
<!--
function abc(){

   return window.confirm("你真的要删除该已下架产品吗？"); 
}
 function check(){
   if(document.form_test.PageNow.value==""){
     window.alert("页数不能为空！");
	 document.form_test.PageNow.focus();
	 return false;
	 
   }
    if(document.form_test.PageNow.value<=0||document.form_test.PageNow.value>PageCount){
     window.alert("页数输入不正确！");
	 document.form_test.PageNow.focus();
	 return false;
	 
   }
  }

-->
</script>
  </head>
<body>

	<div id="contain">
		<div id="user">
		</div>
		<div class="con content_5">
			
				<p style=" margin:20px; color:#666;">已下架产品删除页</p>
				 <%
          for(int i=0;i<listbasic.size();i++){
	       ProductBasicLoadBean pbb = (ProductBasicLoadBean)listbasic.get(i);
	       %> 
	       <div style="float:left;width:740px;">
	       <form style="margin:20px;width:740px;" >
				<div style="float:left;">
					<img style="width:240px; height:200px;" src="<%=pbb.getProductImage() %>" />
				</div>
				<table style="float:left; margin-left:20px; width:400px; height:200px;">
					<tr>
						<td id="name">产品名称：<%=pbb.getProductName() %></td>
						<td id="time_down">下架时间：<%=pbb.getEndTime() %></td>
					</tr>
					<tr>
						<td id="type">产品型号：<%=pbb.getProductType() %></td>
						<td id="price">市&nbsp;场&nbsp;价：<%=pbb.getMarketPrice() %></td>
					</tr>
					<tr>
						<td id="total">产品总量：<%=pbb.getCurrentPNumber() %></td>
						<td id="VIP">会&nbsp;员&nbsp;价：<%=pbb.getRetailPrice() %></td>
					</tr>
					<tr>
						<td id="sell">卖出数量：<%=pbb.getSoldPNumber() %></td>
						<td id="cheap">折&emsp;&emsp;扣：<%=pbb.getProductDiscount() %>&emsp;折</td>
					</tr>
					<tr>
						<td id="time_on">上架时间：<%=pbb.getBeginTime() %></td>
						<td id="delete">操&emsp;&emsp;作：
						
						<a  style="text-decoration:none; color:#666;" onclick="return abc();" href="ManagerBasicLoadDelServlet?ProductID=<%=pbb.getProductID()%>" >删除该已下架产品</a>
					
					</tr>
				</table>
				
			</form>
			<br/>
			
			</div>
			<%} %>
			
			<div id="page">
					<ul>
					
					<% 
					if(PageCount>1){
					
					if(PageNow>1){
						%>
							<li><a  href="ManagerShowBasicLoadServlet?type=del&PageNow=<%=PageNow-1%>" class="page">上一页</a></li>
						
						
						<%
					}
					  
					
						if(PageCount>=showPages){
							if(PageNow-size<=0){
								for(int i=1;i<=showPages;i++){
									%>
									
									<li><a href="ManagerShowBasicLoadServlet?type=del&PageNow=<%=i%>" class="page"" class="num" ><%=i%></a></li>
									<%
								}
								%><li>...</li><%
							}else if(PageNow+size<PageCount){
								for(int i=PageNow-size;i<=PageNow+size;i++){
									%>
									
									<li><a href="ManagerShowBasicLoadServlet?type=del&PageNow=<%=i%>" class="page" class="num" ><%=i%></a></li>
									<%
								}
								%><li>...</li><%
							}else if(PageNow+size>=PageCount){
								for(int i=PageCount-showPages+1;i<=PageCount;i++){
									%>
									
									<li><a href="ManagerShowBasicLoadServlet?type=del&PageNow=<%=i%>" class="num" ><%=i %></a></li>
									<%
								}
							}
							
						}else if(PageCount<=showPages){
							for(int i=1;i<=PageCount;i++){
								%>
								<li><a href="ManagerShowBasicLoadServlet?type=del&PageNow=<%=i%>" class="num" ><%=i %></a></li>
								<%
							}
						}
						if(PageNow<PageCount){
							%>
							<li><a  href="ManagerShowBasicLoadServlet?type=del&PageNow=<%=PageNow+1%>" class="page" ">下一页</a></li>
							<%
						}
						
						%>
						<li>共<%= PageCount%>页&emsp;</li>
						<li>第<%= PageNow%>页&emsp;</li>	
							
							
							  <form name="form_test"  style="display:inline;" action="ManagerShowBasicLoadServlet?type=del" method="post" >
							  跳到<input  type="text" style="width:30px; border:1px solid #CCC;" name="PageNow"/>&emsp;页
                             </form>
						
					</ul>
<%
					}
%>
		</div>
		</div>
	</div>

</body>
</html>
